var status = 0;
var mapid = 922010900;

function start() {
 status = -1;
 action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("OK then, see you next time!");
   			cm.dispose();
   			return;
  		}
		if (mode == 1)
   			status++;
  		else
   			status--;
  		if (status == 0) {
			cm.sendYesNo("I can spawn a boss with 1bil hp for you\r\nThis can only be used with 15 persons in this map\r\nDo you want to spawn her?\r\n(Warning, when used when theres already a boss, the old boss will die and you will NOT get exp");
		} else {
			if (cm.getCharQuantity(mapid) >= 15) {
				cm.getChar().getMap().killMonster(8220003, cm.getChar(), true);
				cm.spawnMob(8220003, 2000000000, 1000, 1, 10000000, 0, 0, 1, 0, 0);
				cm.startEvent(mapid);
				cm.mapMessage("Have fun being dead!");
				cm.dispose();
			} else {
				cm.sendOk("There aren't enough players in the map");
				cm.dispose();
			}
		}
	}
}